<div class="bjui-pageHeader" style="background-color:#fefefe; border-bottom:none;">
    <form data-toggle="ajaxsearch" data-options="{searchDatagrid:$.CurrentNavtab.find('#deviceinfo')}">
        <fieldset>
            <div style="margin:0; padding:1px 5px 5px;">
                <span>用户名：</span>
                <input type="text" name="name" class="form-control" size="15">

                <div class="btn-group">
                    <button type="submit" class="btn-green" data-icon="search">开始搜索！</button>
                    <button type="reset" class="btn-orange" data-icon="times">重置</button>
                </div>
            </div>
        </fieldset>
    </form>
</div>
<div class="bjui-pageContent">
    <table class="table table-bordered" id="deviceinfo" data-toggle="datagrid" data-options="{
        height: '100%',
        local: 'local',
        showToolbar: true,
        toolbarItem: 'add, edit, del',
        dataUrl: '/sysmanage/user/listdata.do',
        editMode: {dialog:{width:'800',height:500,mask:true,title:'编辑'}},
        editUrl: '/sysmanage/user/add.do?{id}',
        delUrl :'/sysmanage/user/del.do',
        paging: {pageSize:20, pageCurrent:1},
        linenumberAll: false,
        filterThead:false,
        sortAll: true
    }">
        <thead>
        <tr>
            <th data-options="{name:'id',align:'center' }" width="100px">id</th>
            <th data-options="{name:'name',align:'center'}" width="140px">用户名</th>
            <th data-options="{render:'setrolename',align:'center'}" width="150px">角色</th>
            <th data-options="{name:'tel',align:'center'}" width="200px">电话</th>
            <th data-options="{name:'memo',align:'center'}" width="200px">备注</th>
        </tr>
        </thead>
    </table>
</div>
<script type="text/javascript">
    function setrolename(value, data) {
        if (data.sysroleByRoleid != null) {
            return data.sysroleByRoleid.name;
        }
        return "";
    }

</script>